<?php

namespace app\admin\controller;

use app\admin\model\DonateApply;
use app\admin\model\Paylog;
use app\admin\model\Tickets;
use app\admin\model\Users;
use app\Request;

class Utils extends Authorization
{
    public function getUserInfo(Request $request){
        return $this->success('ok',$request->admin);
    }
    public function getTotal(Request $request){
        $info = [
            'all_user'          => Users::count(),
            'exist_tickets'     => Tickets::where('type',1)->count(),
            'not_handle_order'  => Paylog::where('status',3)->count(),
            'not_handle_donate' => DonateApply::where('status',3)->count(),
        ];
        return $this->success('ok',$info);
    }
}